unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, jpeg;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Panel1: TPanel;
    Image1: TImage;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure showdemo;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(IntToStr(Integer(@Panel1)));
  ShowMessage(IntToStr(Integer(Addr(Panel1))));

  ShowMessage(IntToStr(Integer(@Image1)));
  ShowMessage(IntToStr(Integer(Addr(Image1))));
  
  ShowMessage(IntToStr(Integer(@OnShow)));
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  PanelA:^TPanel;
  ImageA:^TImage;

  Address:Pointer;
begin


 { PanelA:=nil;
  PanelA:=Pointer(9905152);
  if PanelA<>nil then
  begin
    ShowMessage(panelA.Caption);
    PanelA.Left:=Panel1.Left+10;
  end; }

  {ImageA:=nil;
  ImageA:=Pointer(9905156);
  if ImageA<>nil then
  begin
    ImageA.Left:=imageA.Left+10;
  end;}

  {if TObject(Pointer(9905152)) is TPanel then
  begin
    ShowMessage('true');
  end;}

  //PanelA:=Pointer(9905152);
  //ShowMessage(PanelA.ClassName);
  //Address:=Pointer('');

  Address:=@OnShow;
  asm
    pushad;
    Call Address;
    popad;
  end;
  
end;

procedure TForm1.showdemo;
begin
  ShowMessage('showdemo');
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  ShowMessage('onshow:showdemo');
end;

end.
